package com.taijia.chapter9;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 2015/2/3
 * Time: 22:14
 * To change this template use File | Settings | File Templates.
 */
public class TestPriority {
    public static void main(String[] args) {
        Thread t1 = new Thread(new R1());
        Thread t2 = new Thread(new R2());
        t1.setPriority(Thread.MAX_PRIORITY);
        t2.setPriority(Thread.MIN_PRIORITY);
        t1.start();
        t2.start();
    }
}


class R1 implements Runnable {
    @Override
    public void run() {
        for (int i = 1; i <= 100; i++) {
            System.out.println("I am T1:" + i + "+++");
        }
    }
}

class R2 implements Runnable {
    @Override
    public void run() {
        for (int i = 1; i <= 100; i++) {
            System.out.println("===I am T2:" + i);
        }
    }
}
